home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
AVERAGE.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
591b
|
27 lines
' AVERAGE.BAS
' This program prints the average of three numbers.
DECLARE FUNCTION Average! (int1%, int2%, int3%) ' declare function
CLS
PRINT "Enter three integers to be averaged together."
PRINT
INPUT " First integer: ", first%
INPUT " Second integer: ", second%
INPUT " Third integer: ", third%
PRINT
PRINT "The average is"; Average!(first%, second%, third%)
END
FUNCTION Average! (int1%, int2%, int3%)
sum% = int1% + int2% + int3% ' sum of arguments
Average! = sum% / 3 ' return value is average of arguments
END FUNCTION